import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    example: 'hehe'
  },
  getters: {
    getExample: function(state) {
      return state.example
    }
  },
  mutations: {
    replaceExample(state, str) {
      state.example = str
    }
  },
  actions: {
    replaceAction(context, str) {
      context.commit('replaceExample', str)
    }
  }
})
